package com.mql.learnSpringCloud.service.impl;

import com.example.cloudapicommons.entity.PaymentEntity;
import com.mql.learnSpringCloud.mapper.NacosProviderMapper;
import com.mql.learnSpringCloud.service.NacosProviderService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class NacosProviderServiceImpl implements NacosProviderService {
    @Resource
    private NacosProviderMapper nacosProviderMapper;
    public int add(PaymentEntity paymentEntity) {
        int result=0;
        try {
            result=nacosProviderMapper.add(paymentEntity);
        }
        catch (Exception e){
            return 0;
        }
        return result;
    }

    public PaymentEntity getPaymentEntity(Integer id) {
        PaymentEntity paymentEntity=new PaymentEntity();
        try {
            paymentEntity=nacosProviderMapper.getPaymentEntity(id);
        }catch (Exception e){
            return null;
        }
        return paymentEntity;
    }
}
